#ifndef _ENTITY_CONTAINER_H_
#define _ENTITY_CONTAINER_H_

#ifdef _WIN32
#pragma once
#endif

/**
 * 19.3.12 - Stephen Gore - Original creation.
 */

#include <map>
#include <vector>
#include <string>
#include <algorithm>

#include "entity.h"

using std::pair;
using std::vector;
using std::string;
using std::map;
using std::remove;

class CEntityContainer {
public:
    // Get the instance of the container.
    static CEntityContainer* getInstance();

    // Interact with the entities. 
    CEntity *addEntity(CEntity *pEntity);
    bool removeEntityList(ENTITY_ID key);
    bool removeEntity(CEntity *pEntity);
    vector<CEntity*> getEntityList(ENTITY_ID key) const;
    vector<CEntity*> getEntityList(string key) const;
    
    void clearAllEntities();

    void tick();

    void reset();

private:
    // Constructors.
    CEntityContainer(){}
    CEntityContainer(const CEntityContainer &rhs) {}

    // Destructor.
    ~CEntityContainer();

    // Assignment operator.
    CEntityContainer &operator=(const CEntityContainer&) {}

    map<ENTITY_ID, vector<CEntity*>> m_arrEntities;
};

#endif